<template>
  <div class="ck2">
    <div class="header2">
      <div class="head-font2"></div>
        <p style="font-size:18px;">&nbsp; 新增公告</p>
    </div>
    <div id="add">
        <p style="font-size:18px; padding-left:10px;">通知信息</p>
    </div>

    <div>
        <el-form ref="form" :model="form" label-width="70px">
        <el-form-item label="消息标题" style="width:600px; padding-left:10px;">
            <el-input v-model="form.informationTitle" placeholder="请输入"></el-input>
        </el-form-item>
        <el-form-item label="发布时间" style="padding-left:10px;">
            <el-col :span="10">
            <el-date-picker type="date" placeholder="选择日期" v-model="form.operationDate " format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:200px;"></el-date-picker>
            </el-col>
        </el-form-item>
        <el-form-item label="消息内容" style="padding-left:10px;">
            <el-input type="textarea" v-model="form.informationContent" placeholder="请输入" resize='none' :rows="6" style="width:45%;"></el-input>
        </el-form-item>
        <el-form-item style="padding-left:10px;">
            <el-button type="primary" @click="onSubmit">发布</el-button>
            <el-button>返回</el-button>
        </el-form-item>
        </el-form>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
   data() {
      return {
        form: {
          informationTitle: '',
          operationDate: '',
          informationContent: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        }
      }
    },
    methods: {
      onSubmit() {
    axios({
      url: "/api/install/addInform",
       params: 
          this.form
    }).then(res=>{
        console.log(res.data)
        this.$message('新增成功')
        this.roleList = ''
        this.$router.push({path:'/systemAffiche',});
    })
      }
    }
}
</script>

<style>
.ck2 {
  width: 1250px;
  height: 980px;
}
.header2  {
  width: 1250px;
  height: 50px;
  background-color: rgb(240, 238, 238);
  display: flex;
  padding-top: 20px;
  padding-left: 30px;
  border-bottom: 2px solid gray;
}
.head-font2 {
  background-color: #0066ff;
  width: 7px;
  height: 25px;
  border-radius: 10px;
}
#add{
    width: 1250px;
    height: 40px;
    /* background-color: rebeccapurple; */
    margin-top: 10px;
}

</style>